HEAD <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD ======= >>>>>>> remotes/origin/desync_analysis_all_files
In these experiments glycinergic fibers were photactivated while the firing rate of individual IL neurons was recorded. Some of the IL cells had very low baseline activity. In order to increase the firing rate of the IL neurons and to detect the effect of the glycinergic fiber activation a small tail pinch was applied. The firing rate of the recorded IL cells decreased during the glycinergic fiber activation.
Loading AP and stimuli times from stimulus and from baseline data to IL_stim_firing and to IL_baseline_firing tables:
IL_stim_firing <- CreateRecTibble(AP_times = read_csv(file.path("data",
"IL_MFR", "stimulus", "AP_times.csv")),
stim_times = read_csv(file.path("data",
"IL_MFR", "stimulus", "stim_times.csv")))
IL_stim_firing %>%
head()
<<<<<<< HEAD
<<<<<<< HEAD
IL_baseline_firing <- CreateRecTibble(
AP_times = read_csv(file.path("data", "IL_MFR", "baseline", "AP_times.csv")),
stim_times = read_csv(file.path("data", "IL_MFR", "baseline", "stim_times.csv"))
)
IL_stim_firing %>% head()
<<<<<<< HEAD
<<<<<<< HEAD
Summary information of the stimulus and baseline recording files:
CELL_INFO table to store the cell categories. It was created manually using the information from the summary excel table (Glicy_juxta-fm_exp_records_injection_sum.xls)
b_d_a_MFR: Calculating the number of APs -using a custom made function (BDACalculator)- before during and after the stimulus trains (b_d_a_MFR).
b_d_a_MFR <- lapply(CELL_INFO$cell_id, BDACalculator, data = IL_stim_firing) %>%
bind_rows() %>%
dplyr::mutate(FR = No_AP / train_length) %>%
dplyr::group_by(stim_cond, cell_id) %>%
dplyr::summarise(MFR = mean(FR))
<<<<<<< HEAD
<<<<<<< HEAD
`as.tibble()` was deprecated in tibble 2.0.0.
Please use `as_tibble()` instead.
The signature and semantics have changed, see `?as_tibble`.`summarise()` has grouped output by 'stim_cond'. You can override using the `.groups` argument.
=======
>>>>>>> remotes/origin/desync_analysis_all_files
=======
>>>>>>> remotes/origin/desync_analysis_all_files
sd_mean_isi: Calculating the baseline MFR of the recorded IL cells from the IL_baseline_firing table using a custom made function (SDMeanISI). The results are stored in the sd_mean_isi table.
cellranks: Calculating ranks based on the activity change from “baseline” to “during stimulus”. If the activity change is negative (decreased MFR) the asigned rank is negative, if it is positive (increased MFR) the assigned rank is positive.
Calculating the firing rate change during stimulus (photoactivation of the glycinergic fibers) compared to baseline:
\[\mathbf{activity\_change} = \frac{during\_MFR - base\_MFR}{base\_MFR} * 100\]
cellranks <- b_d_a_MFR %>%
dplyr::group_by(stim_cond) %>%
dplyr::mutate(base_MFR = sd_mean_isi$MFR) %>%
dplyr::mutate(activity_change = ((MFR - base_MFR) / base_MFR * 100) %>% round(2)) %>%
dplyr::filter(stim_cond == "d") %>%
dplyr::mutate(change_rank = ifelse(activity_change > 0,
rank(activity_change),
-rank(-activity_change)
)) %>%
ungroup() %>%
left_join(CELL_INFO %>%
select(cell_id, control, pinch, position),
by = "cell_id"
)
cellranks
<<<<<<< HEAD
<<<<<<< HEAD
cellranks_before_stim: Calculating ranks based on the activity change from “before stimulus” to “during stimulus”. If the activity change is negative (decreased MFR) the asigned rank is negative, if it is positive (increased MFR) the assigned rank is positive.
Calculating the firing rate change during stimulus (photoactivation of the glycinergic fibers) compared to before stimulus:
\[\mathbf{activity\_change} = \frac{during\_MFR - before\_MFR}{before\_MFR} * 100\]
cellranks_before_stim <- b_d_a_MFR %>%
spread(key = stim_cond, value = MFR) %>%
dplyr::mutate(activity_change = ((d - b) / b * 100) %>% round(2)) %>%
dplyr::mutate(change_rank = ifelse(activity_change > 0,
rank(activity_change),
-rank(-activity_change)
)) %>%
left_join(CELL_INFO %>%
select(cell_id, control, pinch, position),
by = "cell_id"
)
cellranks_before_stim
<<<<<<< HEAD
<<<<<<< HEAD
TO_PLOT: Combining b_d_a_MFR (firing rate of 29 IL neurons b/d/a stim) with sd_mean_isi table (baseline firing rate of the same 29 neurons), joining with CELL_INFO containing important information of the cells (baseline activity, identified, pinched, control) and with cellranks containing the ranks asigned to each cells based on the changes in MFR during the stimulus compared to baseline.
TO_PLOT <- bind_rows(
sd_mean_isi %>%
select(MFR, cell_id, stim_cond),
b_d_a_MFR
) %>%
left_join(CELL_INFO %>%
select(-file_name),
by = "cell_id"
) %>%
left_join(cellranks %>%
select(cell_id, change_rank, activity_change),
by = "cell_id"
)
datatable(TO_PLOT,
caption = "TO_PLOT table",
rownames = TRUE,
options = list(pageLength = 50, scrollX = T, scrollY = "500px", dom = "t")
)
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> remotes/origin/desync_analysis_all_files
=======
>>>>>>> remotes/origin/desync_analysis_all_files
Comparison of baseline and “before” stimulus firing rates in the case of spontaneously active and sponteneously inactive (pinch) neurons. Spontaneously inactive neurons showed significantly higher MFR before stiulus compared to baseline.
<<<<<<< HEAD <<<<<<< HEADFiring rate change during stimulus (photoactivation of the glycinergic fibers) compared to baseline:
<<<<<<< HEAD <<<<<<< HEADFiring rate change during stimulus (photoactivation of the glycinergic fibers) compared to before stimulus:
<<<<<<< HEAD <<<<<<< HEADPlotting the change in MFR from “baseline” to “during stimulus”. Coloring based on the strength of the inhibition (rank)
<<<<<<< HEAD <<<<<<< HEADIn these experiments we tested the effect of cortical photo-activation on the firing of PRF glycinergic neurons.